package com.cvpoc.spring.common.controller;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.multiaction.MultiActionController;

public class InfoController extends MultiActionController {

    protected final Log logger = LogFactory.getLog(getClass());

    public ModelAndView helloInfo(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {

        logger.info("returning hello view with ");
        logger.info(request.getParameter("id"));

        Map<String, Object> myModel = new HashMap<String, Object>();
        myModel.put("message", "action hello method");
        return new ModelAndView("InfoPage", "model", myModel);
    }
    
    public ModelAndView infospecialInfo(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {

        logger.info("returning hello view with ");

        Map<String, Object> myModel = new HashMap<String, Object>();
        myModel.put("message", "action infospecial method");
        return new ModelAndView("InfoPage", "model", myModel);
    }
}